package www.xudan.android_ffmpeg;

import androidx.appcompat.app.AppCompatActivity;

import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.Display;
import android.view.MotionEvent;
import android.view.View;
import android.widget.TextView;

import www.xudan.android_ffmpeg.ffmpeg.FFmpegUtils;
import www.xudan.android_ffmpeg.utils.DisplayUtil;
import www.xudan.android_ffmpeg.videoplayer.sample.Sample3Activity;

public class MainActivity extends AppCompatActivity {


    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        // Example of a call to a native method
        TextView tv = findViewById(R.id.sample_text);
        tv.setText(FFmpegUtils.stringFromJNI() + "--"
                + FFmpegUtils.urlprotocolinfo() + "--"
                + FFmpegUtils.avformatinfo() + "--"
                + FFmpegUtils.avcodecinfo() + "--"
                + FFmpegUtils.avfilterinfo());

        DisplayUtil.getRealScreenRelatedInformation(this);
        DisplayUtil.getScreenRelatedInformation(this);
    }

    public void jump(View view) {
        startActivity(new Intent(this, TestActivity.class));
    }

    public void jump_ijk(View view) {
        startActivity(new Intent(this, IjkPlayerActivity.class));
    }

    @Override
    public boolean dispatchTouchEvent(MotionEvent ev) {
        Log.i("xd----", "activity--" + super.dispatchTouchEvent(ev));
        return super.dispatchTouchEvent(ev);
    }

    @Override
    public boolean onTouchEvent(MotionEvent event) {
        Log.i("xd----", "activity--" + super.onTouchEvent(event));
        return super.onTouchEvent(event);
    }

    public void jump_player(View view) {
        startActivity(new Intent(this, Sample3Activity.class));
    }
}
